#include <iostream>
#include "rustSharedLib.h"

using namespace std;

void handler(const char* input_message, char** output_message) {
    cout << "Display in CXX handler function =>" << input_message << endl;
    char msg[] = "This message comes from CXX handler function!";
    char c = msg[0];
    int pointer = 0;

    while (c != '\0'){
        output_message[0][pointer++] = c;
        c = msg[pointer];
    }

    output_message[0][pointer] = '\0';
}

int main(int argc, char** argv) {
    SampleStruct arg;
    arg.handler = (void* (*)(const char*, char**))handler;

    try_it(arg);

    return 0;
}